package com.ruipengkj.component;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JButton;

import com.ruipengkj.commons.util.Util;

public class RPJButton extends JButton {

	private static final long serialVersionUID = 1L;
	private Color color=new Color(39,139,224);
	public RPJButton(String text){
		super(text);
		setContentAreaFilled(false); // 这一句非常重要, 否则父类还会绘制按钮的区域. 
		setForeground(Color.BLACK);
		setFont(Util.FONT_13_BOLD);
		setCursor(Util.CURSOR_HAND);
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		if (getModel().isRollover()) {
			setForeground(color);
		}else{
			setForeground(Color.BLACK);
		}
		super.paintComponent(g);
	}
}
